* Dino Christenson & David Glick 
* Replication Stata script for "Reassessing the Supreme Court: How Decisions & Negativity Bias Affect Legitimacy." Political Research Quarterly.  
* Panel Setup 
* July 2018 

clear

***** Panel data formatting *****

**load data
cd "/Users/dino/Dropbox (Personal)/K Drive/Healthcare Inception/data analysis backups/prq18_replication"
use "data/CompletePanel_Raw_Anonymized_Vars_Recoded.dta", replace

**reshape for panel data 
generate	individualid = _n

**let's reshape the dynamic variables 
reshape long ///
legit_index_W   ///
legit_index_scaled_W ///
ideol_distance_W /// 
knows_vra_decision_W ///
knows_gm_decision_W  ///
, i(individualid) j(wave) 


**dummies for the waves 
gen wave1 = 0
replace wave1 = 1 if wave==1
gen wave2 = 0
replace wave2 = 1 if wave==2
gen wave3 = 0
replace wave3 = 1 if wave==3
gen wave4 = 0
replace wave4 = 1 if wave==4
gen wave5 = 0
replace wave5 = 1 if wave==5
gen wave6 = 0
replace wave6 = 1 if wave==6

**longitudinal specification 
xtset individualid wave 


**Save the panel version  
save "data/CompletePanel_RAVR_Panel_Setup.dta", replace
saveold "data/CompletePanel_RAVR_Panel_Setup_old.dta", version(12) replace


clear


* eof *************************************************************************
